package main.java.mediator;

/**
 * 中介者模式
 */
public class Demo {
    public static void main(String[] args) {
        //创建中介者
        MediatorStructure mediatorStructure = new MediatorStructure();

        HouseOwner houseOwner = new HouseOwner("张三", mediatorStructure);
        Tenant tenant = new Tenant("李四", mediatorStructure);

        mediatorStructure.setHouseOwner(houseOwner);
        mediatorStructure.setTenant(tenant);


        tenant.constact("询问房源");
        houseOwner.constact("我有房子，你想租嘛");
    }
}
